GCC = g++
CPPFLAGS = -g -finline-functions -Wall -Winline -pipe -DOS_LINUX
HEAD_INFO = -DPROJECT_NAME="\"FASTSEARCH\"" -DDESCRIPTION="\"FastSearch indexer\""
COMMON_PATH = ../../common
FRAME_PATH = ../frame
	  
INCLUDES = -I./ -I$(FRAME_PATH)/search_proto/output/include \
		   -I$(COMMON_PATH)/commonlib/output/include \
	       -I$(COMMON_PATH)/protobuf/include 

LIBS     = -L./ \
           -L$(FRAME_PATH)/search_proto/output/lib -lsearchpb \
           -L$(COMMON_PATH)/commonlib/output/lib -lcommonlib \
	       $(COMMON_PATH)/protobuf/lib/libprotobuf.a \
	       -lpthread

all : liblist_sorter.a
	  mkdir -p output/include
	  mkdir -p output/lib
	  cp *.h output/include
	  cp *.a output/lib
	  make -C test
	  


liblist_sorter.a : list_sorter.o
	$(AR) -crv $@ $^

%.o : %.cpp
	$(GCC) $(CPPFLAGS) $(HEAD_INFO) -c $< -o $@ $(INCLUDES)

clean :
	rm -f *.o
	rm -rf *.a
	rm -rf output
	make -C test clean

